package com.bk.controller.cardInfo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.bk.entity.CardInfo;
import com.bk.entity.UserInfo;
import com.bk.service.cardInfo.CardInfoService;
import com.bk.util.ReturnUtil;

@RestController/**账户信息管理*/
public class CardInfoController {

	@Autowired
	private CardInfoService cardInfoService;
	
	@PostMapping("/blockOrUnBlockAccount/{block}")/**账户锁定*/
	public ReturnUtil<CardInfo> blockOrUnBlockAccount(@PathVariable("block") int block,UserInfo userInfo,CardInfo cardInfo){
		
		ReturnUtil<CardInfo> ru=cardInfoService.blockOrUnBlockAccount(block,userInfo,cardInfo);
		return ru;
	}
	@PostMapping("/closeAccount")/**销户*/
	public ReturnUtil<Integer> closeAccount(@RequestParam("cardId") String cardId,@RequestParam("uname") String uname,@RequestParam("uid")String uid,@RequestParam("utelephone")String utelephone ){
		ReturnUtil<Integer> ru=cardInfoService.closeAccount(cardId,uname,uid,utelephone);
		return ru;
	}
}
